<?xml version="1.0" encoding="utf-8"?>

<!--
SPDX-FileCopyrightText: Adam Evyčędo

SPDX-License-Identifier: GPL-3.0-or-later
-->

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tool="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="16dp">

    <com.google.android.material.bottomsheet.BottomSheetDragHandleView
        android:id="@+id/drag_handle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="parent" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/arrival_status"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="0dp"
        android:visibility="gone"
        android:textAppearance="@style/TextAppearance.Material3.BodySmall"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/drag_handle"
        tool:text="approx. arr." />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/arrival_time"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="0dp"
        android:visibility="gone"
        android:textAppearance="@style/TextAppearance.Material3.DisplaySmall"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/arrival_status"
        tool:text="at 12:10:30" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/departure_status"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:visibility="gone"
        android:textAppearance="@style/TextAppearance.Material3.BodySmall"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/arrival_time"
        tool:text="approx. dep." />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/departure_time"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="0dp"
        android:visibility="gone"
        android:textAppearance="@style/TextAppearance.Material3.DisplaySmall"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/departure_status"
        tool:text="at 12:10:30" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/local_time"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/local_time"
        android:visibility="gone"
        app:layout_constraintEnd_toEndOf="@+id/departure_time"
        app:layout_constraintStart_toStartOf="@+id/departure_time"
        app:layout_constraintTop_toBottomOf="@+id/departure_time" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/offset"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="4dp"
        android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
        android:visibility="gone"
        app:layout_constraintBaseline_toBaselineOf="@+id/arrival_time"
        app:layout_constraintStart_toEndOf="@+id/arrival_time"
        tool:text="(+2 min)" />

    <ImageView
        android:id="@+id/rt_icon"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:layout_marginStart="16dp"
        android:contentDescription="@string/realtime_content_description"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/drag_handle"
        app:srcCompat="@drawable/radar" />

    <ImageView
        android:id="@+id/wheelchair_icon"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:layout_marginStart="8dp"
        android:contentDescription="@string/wheelchair_content_description"
        app:layout_constraintStart_toEndOf="@id/rt_icon"
        app:layout_constraintTop_toTopOf="@+id/rt_icon"
        app:srcCompat="@drawable/wheelchair" />

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/line"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="8dp"
        android:textAlignment="center"
        android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/local_time" />

    <androidx.constraintlayout.helper.widget.Flow
        android:id="@+id/info"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="48dp"
        android:layout_marginTop="48dp"
        android:layout_marginEnd="48dp"
        app:constraint_referenced_ids="boarding,speed,congestion,occupancy"
        app:flow_horizontalGap="4dp"
        app:flow_horizontalStyle="spread_inside"
        app:flow_verticalGap="4dp"
        app:flow_wrapMode="chain"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/line" />

    <LinearLayout
        android:id="@+id/boarding"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_vertical">

        <ImageView
            android:id="@+id/boarding_icon"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:layout_marginEnd="8dp"
            android:importantForAccessibility="no"
            app:srcCompat="@drawable/transfer" />

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/boarding_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
            tool:text="on demand" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/speed"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_vertical">

        <ImageView
            android:id="@+id/speed_icon"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:layout_marginEnd="8dp"
            android:importantForAccessibility="no"
            app:srcCompat="@drawable/speed" />

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/speed_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
            tool:text="10 Vl" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/congestion"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_vertical">

        <ImageView
            android:id="@+id/congestion_icon"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:layout_marginEnd="8dp"
            android:importantForAccessibility="no"
            app:srcCompat="@drawable/traffic" />

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/congestion_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
            tool:text="smooth traffic" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/occupancy"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_vertical">

        <ImageView
            android:id="@+id/occupancy_icon"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:layout_marginEnd="8dp"
            android:importantForAccessibility="no"
            app:srcCompat="@drawable/crowd" />

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/occupancy_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
            tool:text="empty vehicle" />
    </LinearLayout>

    <androidx.constraintlayout.helper.widget.Flow
        android:id="@+id/capabilities"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="8dp"
        app:constraint_referenced_ids="ac,bike,voice,ticket,usb"
        app:flow_horizontalGap="4dp"
        app:flow_horizontalStyle="packed"
        app:flow_verticalGap="4dp"
        app:flow_wrapMode="chain"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/info" />

    <ImageView
        android:id="@+id/ac"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:contentDescription="@string/air_condition_content_description"
        app:srcCompat="@drawable/ac"
        tool:ignore="MissingConstraints" />

    <ImageView
        android:id="@+id/bike"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:contentDescription="@string/bicycles_allowed_content_description"
        app:srcCompat="@drawable/bike"
        tool:ignore="MissingConstraints" />

    <ImageView
        android:id="@+id/voice"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:contentDescription="@string/voice_announcements_content_description"
        app:srcCompat="@drawable/voice"
        tool:ignore="MissingConstraints" />

    <ImageView
        android:id="@+id/ticket"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:contentDescription="@string/tickets_sold_content_description"
        app:srcCompat="@drawable/ticket"
        tool:ignore="MissingConstraints" />

    <ImageView
        android:id="@+id/usb"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:contentDescription="@string/usb_charging_content_description"
        app:srcCompat="@drawable/usb"
        tool:ignore="MissingConstraints" />

    <LinearLayout
        android:id="@+id/alerts"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:background="@color/safety"
        android:gravity="center_vertical"
        android:visibility="gone"
        app:layout_constraintTop_toBottomOf="@+id/capabilities">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:importantForAccessibility="no"
            android:src="@drawable/warning"
            app:tint="@color/black" />

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/alerts_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:padding="8dp"
            android:textColor="@color/black"
            tool:text="Severe stops on Metropolitan line towards Tower Hill through Victoria" />
    </LinearLayout>

    <org.osmdroid.views.MapView
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:layout_margin="16dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/alerts" />
</androidx.constraintlayout.widget.ConstraintLayout>
